package ptaTest1;

import java.util.Scanner;
public class Test13 {
	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner in = new Scanner(System.in);
        double num=in.nextDouble();
        String str = Double.toString(num);
        while(str!=null)
        {
        char []a=str.toCharArray();
        int i=0,sum=0;
        int x=a.length;
        for(i=0;i<x;i++)
        {if(a[i]!='.'&&a[i]!='-'){
        	sum=a[i]+sum-48;
        }
        }
        System.out.println(sum);
        num=in.nextDouble();
        str = Double.toString(num);
        }
	}
}